﻿using YDT_ProductService.Application.DTOs;
using YDT_ProductService.Domains.Enums;

namespace YDT_ProductService.Application.Interfaces
{
    /// <summary>
    /// 商品应用服务接口 - 定义商品业务操作
    /// </summary>
    public interface IProductService
    {
        /// <summary>根据ID获取商品</summary>
        Task<ProductDto?> GetProductByIdAsync(Guid id);
        /// <summary>根据商品编码获取商品</summary>
        Task<ProductDto?> GetProductByCodeAsync(string productCode);
        /// <summary>获取所有商品</summary>
        Task<IEnumerable<ProductDto>> GetAllProductsAsync();
        /// <summary>根据状态获取商品</summary>
        Task<IEnumerable<ProductDto>> GetProductsByStatusAsync(ProductStatus status);
        /// <summary>分页查询商品</summary>
        Task<(IEnumerable<ProductDto> Products, int TotalCount)> GetPagedProductsAsync(ProductQueryDto query);
        /// <summary>创建商品</summary>
        Task<ProductDto> CreateProductAsync(CreateProductDto createProductDto);
        /// <summary>更新商品</summary>
        Task<ProductDto?> UpdateProductAsync(Guid id, UpdateProductDto updateProductDto);
        /// <summary>删除商品</summary>
        Task<bool> DeleteProductAsync(Guid id);
        /// <summary>更新商品库存</summary>
        Task<ProductDto?> UpdateProductStockAsync(Guid id, int newStock);
        /// <summary>增加商品库存</summary>
        Task<ProductDto?> IncreaseProductStockAsync(Guid id, int quantity);
        /// <summary>减少商品库存</summary>
        Task<ProductDto?> DecreaseProductStockAsync(Guid id, int quantity);
        /// <summary>增加商品销量</summary>
        Task<ProductDto?> IncreaseProductSoldAsync(Guid id, int quantity);
        /// <summary>激活商品</summary>
        Task<ProductDto?> ActivateProductAsync(Guid id);
        /// <summary>禁用商品</summary>
        Task<ProductDto?> DeactivateProductAsync(Guid id);
        /// <summary>添加商品图片</summary>
        Task<ProductDto?> AddProductImageAsync(Guid productId, CreateProductImageDto imageDto);
        /// <summary>移除商品图片</summary>
        Task<ProductDto?> RemoveProductImageAsync(Guid productId, Guid imageId);
    }
}
